import request from '@/api/request';

/**
 * 分页
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMaPageApi = query => {
    return request({
        url: '/api/setup/wechat/config/ma/page',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 详情
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMaDetailApi = query => {
    return request({
        url: '/api/setup/wechat/config/ma/getDetail',
        method: 'get',
        params: query,
        isLoading: true
    });
};

/**
 * 添加
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMaSaveApi = query => {
    return request({
        url: '/api/setup/wechat/config/ma/save',
        method: 'post',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMaEditApi = query => {
    return request({
        url: '/api/setup/wechat/config/ma/edit',
        method: 'put',
        data: query,
        isLoading: true
    });
};

/**
 * 编辑状态
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMaEditStatusApi = query => {
    return request({
        url: '/api/setup/wechat/config/ma/editStatus',
        method: 'put',
        params: query,
        isLoading: true
    });
};

/**
 * 删除
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMaRemoveApi = query => {
    return request({
        url: '/api/setup/wechat/config/ma/removeByIds',
        method: 'delete',
        params: query,
        isLoading: true
    });
};

/**
 * 导出模版
 * @returns 返回Promise对象
 */
export const wechatConfigMaExportTemplateApi = () => {
    return request({
        url: '/api/setup/wechat/config/ma/exportTemplate',
        method: 'get',
        responseType: 'blob',
        isLoading: true
    });
};

/**
 * 导入
 * @param {*} query 参数
 * @returns 返回Promise对象
 */
export const wechatConfigMaImportByTemplateApi = query => {
    return request({
        url: '/api/setup/wechat/config/ma/importByTemplate',
        method: 'post',
        data: query,
        responseType: 'blob',
        isLoading: true
    });
};
